package com.paolu.function;

import com.paolu.utils.BallNumber;

import java.util.Arrays;
import java.util.Random;

public class RandomBallNumber {


    public BallNumber randomNumber(BallNumber numbers){
        Random random = new Random();


        int[] rednums = new int[6];
        for (int i = 0; i < rednums.length; i++) {
            int rednum = random.nextInt(33)+1;
            rednums[i] = rednum;
        }
        Arrays.sort(rednums);
        numbers.setRedNum(rednums);

        int blueNum = random.nextInt(16)+1;
        numbers.setBlueNum(blueNum);

        return numbers;
    }


}
